package com.sky.controller.admin;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController("adminShopController")
@Slf4j
@Api(tags = "shop")
@RequestMapping("/admin/shop")
public class ShopController {


    @Autowired
    RedisTemplate redisTemplate;

    @PutMapping("/{status}")
    public Result<Integer> SetStatus(@PathVariable Integer status) {
        redisTemplate.opsForValue();

        redisTemplate.opsForValue().set("status", status);
        return Result.success();
    }


    @GetMapping("/status")
    public Result GetStatus() {
        Integer kk = (Integer) redisTemplate.opsForValue().get("status");
        return Result.success(kk);
    }



}
